<template>
	<view class="pages">
	</view>
</template>

<script>
export default {
	data() {
		return {
		};
	},
	onShow() {
		this.timeToLink();
	},
	methods: {
		timeToLink() {
			let that = this;
			that.timer = setTimeout(function() {
				clearTimeout(that.timer);
				// #ifdef H5
					setTimeout(() => {
						that.$tools.switchTab('/pages/index/index');
					}, 1000);
				// #endif
				// #ifdef APP-PLUS
					let isLogin = uni.getStorageSync('token') != '';
					if (isLogin) {
						setTimeout(() => {
							that.$tools.switchTab('/pages/index/index');
						}, 100);
					} else {
						setTimeout(() => {
							that.$tools.redirectTo('/pages/operate/login');
						}, 100);
					}
				// #endif
			}, 100);
		}
	}
};
</script>

<style lang="scss" scoped>
</style>
